import numpy as np
import json 
import torch 

def get_metric(line):
    line = line.strip("\n")

    line = json.loads(line)
    dices = line["dices"]
    return dices

model_names = ["segresnet", "vnet", "swinunet2d", "transbts", 
                    "densehnet", "unet_plus", "att_unet3d", "att_unet25d", 
                    "att_unet2d", "att_unet3d_ml", "att_unet25d_ml", "att_unet2d_ml",
                    "unet3d", "unet25d", "unet2d", "unet3d_ml", "fuse_unet"]

with open("./huanhu_res.txt") as f :
    lines = f.readlines()
    unet_dices = get_metric(lines[0]) ## 对比方法


    unet_ml_dices = get_metric(lines[15]) ## unet-ml
    fuse_unet = get_metric(lines[-1]) ## fuse-unet
    
##  读出来对应的数据，可以在这里计算显著性。
